@isTest
private class SalesReceiptDetailHandlerTest{
   static testMethod void testMethod1(){
   //创建用户
        Id engProfile = [Select Id From Profile Where Name ='销售部直销销售员'].Id;
        User u1 = new User( Alias = 'samLdc1', 
                         Email = 'ldc@test.com.maike',
                         Emailencodingkey = 'UTF-8', 
                         Lastname = '用户1', 
                         Languagelocalekey = 'en_US',
                         Localesidkey = 'en_US', 
                         Profileid = engProfile, 
                         Country = 'United States',
                         IsActive = true,
                         SubCompany__c='四川省迈克实业有限公司',
                         UserDepartment__c='客户服务中心(工程部)',
                         Timezonesidkey = 'America/Los_Angeles', 
                         EmployeeNumber = '000222',
                         Username = 'Matldc1@test.com.maike' 
                        );
       insert u1;
       
       //创建收款明细
       SalesReceiptDetail__c s = new SalesReceiptDetail__c();
       s.ywy_number__c = '000222';
       s.corp_name__c = '四川迈克';
       
       
       insert s;
        s.Name = '测试';
       update s;
        System.assertEquals(u1.Id,[select OwnerId from SalesReceiptDetail__c where id =:s.Id].OwnerId);
   
   }
 
  
}